<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:tiles="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" lang="en">
<head>
<title>page1.html</title>

<meta name="keywords" content="keyword1,keyword2,keyword3" />
<meta name="description" content="this is my page" />
<meta name="content-type" content="text/html; charset=UTF-8" />

</head>
<body tiles:fragment="content">
	<p th:if="${#lists.isEmpty(cart.items)}">Your cart is empty!</p>

	<table border="1">
		<tr>
			<th>Name</th>
			<th>Quantity</th>
			<th>Unit Price</th>
			<th>Total</th>
		</tr>
		<tr th:each="item : ${cart.items}">
			<td th:text="${item.product.name}"></td>
			<td th:text="${item.product.amount }"></td>
			<td th:text="${item.quantity}"></td>
			<td th:text="${item.totalPrice }"></td>
		</tr>
		<tr>
			<td>Total:</td>
			<td colspan="3" align="right" th:text="${cart.totalPrice}"></td>
		</tr>
	</table>
   <br/>
   <br/>
   <br/>
   
    = = Choice Product = =
    <table border="1">
    	<tr>
    		<th>
    			Name
    		</th>
    		<th>
    			Amount
    		</th>
    		<th>
    			Option
    		</th>
    	</tr>
		<tr th:each="product : ${products}">
			<td th:text="${product.name}">
			</td>
			<td th:text="${product.amount}">
			</td>
			<td>
				<a th:href="@{'~'+${flowExecutionUrl}(_eventId='addToCart',productCode=${product.code})}">Buy</a>
			</td>
		</tr>
    </table>
    <br/>
    <a th:href="@{'~' + ${flowExecutionUrl}(_eventId='submit')}">Submit</a>
  </body>
</html>
